Repository navigation
fix: copy 3D model source links and web extension parts when extracting slides - #566
Merged
sergey-tihon merged 3 commits intoNov 26, 2026
Conversation
…ng slides A slide with am3d:attrSrcUrl or we:webextensionref keeps a relationship id that points to nothing, because the hyperlink relationship and the web extension part (with its snapshot image) are not copied.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The regression test incorrectly validates Office 2013 markup against Office 2007 schemas, and linked web-extension snapshots still retain dangling relationship references.
2 open issues
What changed in this PR
This PR extends PowerPoint slide extraction to preserve 3D model source hyperlinks and web extension parts, addressing relationship-copying gaps left after #563.
Changes:
- Copies and rewrites 3D model source hyperlink relationships.
- Copies slide web extensions and their embedded snapshot images.
- Adds regression tests using existing presentation fixtures.
| File | Description |
|---|---|
| Clippit/PtOpenXmlUtil.cs | Adds the 3D model source URL XML name. |
| Clippit/PowerPoint/Fluent/PresentationBuilderTools.cs | Handles 3D model source hyperlinks during relationship copying. |
| Clippit/PowerPoint/Fluent/FluentPresentationBuilder.Copy.cs | Copies web extension parts and embedded snapshots. |
| Clippit.Tests/PowerPoint/PresentationBuilderTests.cs | Adds source-link and web-extension extraction tests. |
Review effort: Balanced
Update validation to use Office 2013 file format version. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Problem
Follow-up to #563. When a slide is extracted, two kinds of relationship are not copied. The new slide keeps an
r:idthat points to nothing, so the output is invalid and some consumers cannot render it.am3d:attrSrcUrl r:idinsideam3d:model3dis the hyperlink to the source of a 3D model. fix: copy 3D model parts when extracting slides #563 copies the.glbpart and the raster preview, but not this hyperlink.we:webextensionref r:idinsidea:graphicDatapoints to a web extension part (an Office add-in on the slide). There is no handler for it, so the part and its snapshot image are not copied.Fix
AddRelationshipshandlesam3d:attrSrcUrlthe same way asa:hlinkClick: it copies the hyperlink relationship and rewrites the id.CopyRelatedPartsForContentPartscopies the web extension part forwe:webextensionrefand rewrites the id. It then runs the usual relationship copy on the new part, so thewe:snapshot r:embedimage is copied too. This is the same pattern that the diagram parts use, and it matchesDocumentBuilder, which keeps web extensions for Word.Tests
PB011_SlideWith3DModelSourceUrl: addsam3d:attrSrcUrland a hyperlink relationship to thePB008-3DModel.pptxslide in memory, extracts the slide, and checks that the id resolves to the same external URL.PB012_SlideWithWebExtension: adds a web extension part with a snapshot image to a slide in memory, extracts the slide, and checks the part, its XML and the snapshot image.Validate, which includesRelationshipValidator. Both fail without the fix with a "not registered on this part" error.